package com.choosefine.base.attendance.client.scheduing

import com.choosefine.base.attendance.client.mq.AttendanceProducer
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Configurable
import org.springframework.scheduling.annotation.EnableScheduling
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Component
import java.text.SimpleDateFormat


/**
 * Created by 邱鹏 on 2017/8/29.
 */
@Component
@Configurable
@EnableScheduling
class ScheduledTasks {
    @Autowired lateinit var producer: AttendanceProducer//考勤设备的操作接口

    @Scheduled(fixedRate = (1000 * 30).toLong()) //30秒同步一次
    fun reportCurrentTime() {

    }


    @Scheduled(cron = "0 */5 *  * * * ") //每5分钟执行一次
    fun reportCurrentByCron() {

    }

    private fun dateFormat(): SimpleDateFormat {
        return SimpleDateFormat("HH:mm:ss")
    }

}